package com.ruoyi.system.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import start.spring.basic.ry.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;


/**
 * 系统日志对象 gg_sys_log
 * 
 * @author xuyy
 * @date 2023-06-27
 */
@Data
@TableName("gg_sys_log")
@ApiModel(value="gg_sys_log表映射对象", description="")
public class GgSysLog implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "逻辑主键")
    @TableField("id")
    private Long id;

    @ApiModelProperty(value = "业务类型")
    @TableField("biz_type")
    @Excel(name = "业务类型")
    private String bizType;

    @ApiModelProperty(value = "用户账号")
    @TableField("user_id")
    @Excel(name = "用户账号")
    private String userId;

    @ApiModelProperty(value = "用户名")
    @TableField("user_name")
    @Excel(name = "用户名")
    private String userName;

    @ApiModelProperty(value = "TraceId")
    @TableField("trace_id")
    @Excel(name = "TraceId")
    private String traceId;

    @ApiModelProperty(value = "请求类名")
    @TableField("class_name")
    private String className;

    @ApiModelProperty(value = "请求方法名")
    @TableField("method_name")
    private String methodName;

    @ApiModelProperty(value = "处理结果代码")
    @TableField("code")
    @Excel(name = "处理结果代码")
    private String code;

    @ApiModelProperty(value = "异常信息")
    @TableField("msg")
    private String msg;

    @ApiModelProperty(value = "所属子系统代码")
    @TableField("sys_code")
    @Excel(name = "所属子系统", readConverterExp = "10=系统管理子系统,11=demo子系统,12=自动任务子系统,13=对外接口子系统,14=日志记录子系统")
    private String sysCode;

    @ApiModelProperty(value = "请求url")
    @TableField("url")
    private String url;

    @ApiModelProperty(value = "请求开始时间")
    @TableField("start_time")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "请求开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date startTime;

    @ApiModelProperty(value = "请求开始时间起")
    @TableField(exist=false)
    private String beginStartTime;
    
    @ApiModelProperty(value = "请求开始时间止")
    @TableField(exist=false)
    private String endStartTime;

    @ApiModelProperty(value = "请求结束时间")
    @TableField("end_time")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "请求结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date endTime;

    @ApiModelProperty(value = "请求处理耗时")
    @TableField("clhs")
    @Excel(name = "请求处理耗时")
    private Long clhs;

    @ApiModelProperty(value = "controller请求参数")
    @TableField("request_args")
    private String requestArgs;

    @ApiModelProperty(value = "controller响应结果")
    @TableField("oper_result")
    private String operResult;

    @ApiModelProperty(value = "service层记录信息")
    @TableField("oper_detail")
    private String operDetail;

	
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("bizType", getBizType())
            .append("userId", getUserId())
            .append("userName", getUserName())
            .append("traceId", getTraceId())
            .append("className", getClassName())
            .append("methodName", getMethodName())
            .append("code", getCode())
            .append("msg", getMsg())
            .append("sysCode", getSysCode())
            .append("url", getUrl())
            .append("startTime", getStartTime())
            .append("endTime", getEndTime())
            .append("clhs", getClhs())
            .append("requestArgs", getRequestArgs())
            .append("operResult", getOperResult())
            .append("operDetail", getOperDetail())
            .toString();
    }
}
